package com.zhw.mapper;

import com.zhw.pojo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DeptMapper {

    @Select("select * from dept")
    public List<Dept> getDept();

    @Delete("delete from dept where id=#{id}")
    void delete(int id);


    void add(Dept d);

    @Select("select * from dept where id=#{id}")
    Dept selectById(Integer id);

    @Update("update  dept set name=#{name} where id=#{id}")
    void update(Dept dept);
}
